from condor_python_worker.condor import *

def generate_jobs():
    jobs = ['hello.py %d'%i for i in range(100)]
    return jobs

jobs = generate_jobs()

def collect(monitor):
    fin = open(monitor.outfile())
    result = fin.readline().strip()
    lines = fin.readlines()
    fin.close()

    if not result == 'TRUE':
        return False

    fout = open('out','a+')
    for line in lines:
        fout.write(line)
    fout.close()

    return True
